/*
package com.huo.SprinBootDmeo.config;

import com.mongodb.MongoClientURI;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.MongoDbFactory;
import org.springframework.data.mongodb.core.SimpleMongoDbFactory;

*/
/**
 * @Description:
 * @USER: yangw
 * @Date: 2018/4/1
 * @Time: 10:57
 * @version:1.0
 *//*

@Configuration
public class MongoDbConfig {
    @Value("${spring.data.mongodb.uri}")
    String uri;
    @Value("${spring.data.mongodb.databaseName}")
    String databaseName;
    @Value("${spring.data.mongodb.username}")
    String userName;
    @Value("${spring.data.mongodb.password}")
    String password;
    @Bean
    public MongoDbFactory mongoDbFactory(){
        String url ="mongodb://"+userName+":"+password+"@"+uri+"/"+databaseName;
        MongoClientURI clientURI = new MongoClientURI(url);
        MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(clientURI);
        return mongoDbFactory;

    }

}
*/
